﻿using System;
using System.Web;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data;
using System.Data.Entity;
//using System.Data.Entity.Database;
using System.Data.Entity.Infrastructure;
using System.Linq;
using System.Diagnostics;
using System.Web.Mvc;

namespace FILSTARTUPS_CMS.Models
{
    public class User
    {
        [Key]
        public int useridPK { get; set; }

        [Column]
        [Display(Name = "Firstname")]
        [Required(ErrorMessage = "Firstname is required")]
        public string firstname { get; set; }

        [Column]
        [Display(Name = "Lastname")]
        [Required(ErrorMessage = "Lastname is required")]
        public string lastname { get; set; }

        [Column]
        [MinLength(6, ErrorMessage = "Minimum of 6 characters")]
        [Display(Name = "Username")]
        [RegularExpression("^([a-zA-Z ]*[a-zA-Z][a-zA-Z0-9 ]*)$")]
        [Required(ErrorMessage = "Please enter a username")]
        public string Username { get; set; }

        [MinLength(8, ErrorMessage = "Minimum of 8 characters is required")]
        [Column]
        [DataType(DataType.Password)]
        [Display(Name = "Password")]
        [Required(ErrorMessage = "Please enter a password")]
        public string Password { get; set; }

        public DateTime Date_Join { get; set; }

        //[ForeignKey("Role")]
        public int roleidFK { get; set; }

        public bool UserStatus { get; set; }
    }
    public class LogOnModel
    {

        [Required(ErrorMessage = "Username is required")]
        [Display(Name = "Username",
            Description = "Helo User")]
        public string UserName { get; set; }

        [Required(ErrorMessage = "Password is required")]
        [DataType(DataType.Password)]
        [Display(Name = "Password")]
        public string Password { get; set; }
    }
    public class UserGrid
    {
        public string username { get; set; }
        public string rolename { get; set; }
        public string firstname { get; set; }
        public string lastname { get; set; }
        public int useridPK { get; set; }
    }
}